#include <stdio.h>

int add(char , long, int, int);

int main(void)
{
	add(1,2,3,4);
	return 0;
}

int add(char a, long b, int c, int d)
{
	return (a + b + c + d);
}

#if 0

/*
 * intel
 */
0000000000001129 <main>:
    1129:	f3 0f 1e fa          	endbr64 
    112d:	55                   	push   %rbp
    112e:	48 89 e5             	mov    %rsp,%rbp
    1131:	b9 04 00 00 00       	mov    $0x4,%ecx
    1136:	ba 03 00 00 00       	mov    $0x3,%edx
    113b:	be 02 00 00 00       	mov    $0x2,%esi
    1140:	bf 01 00 00 00       	mov    $0x1,%edi
    1145:	e8 07 00 00 00       	callq  1151 <add>	// add(edi, esi, edx, ecx)
    114a:	b8 00 00 00 00       	mov    $0x0,%eax
    114f:	5d                   	pop    %rbp
    1150:	c3                   	retq   

0000000000001151 <add>:
    1151:	f3 0f 1e fa          	endbr64 
    1155:	55                   	push   %rbp
    1156:	48 89 e5             	mov    %rsp,%rbp
    1159:	89 f8                	mov    %edi,%eax
    115b:	48 89 75 f0          	mov    %rsi,-0x10(%rbp)
    115f:	89 55 f8             	mov    %edx,-0x8(%rbp)
    1162:	89 4d ec             	mov    %ecx,-0x14(%rbp)
    1165:	88 45 fc             	mov    %al,-0x4(%rbp)	// (rbp-0x4)=al
    1168:	0f be 45 fc          	movsbl -0x4(%rbp),%eax	// eax=(rbp-0x4)
    116c:	48 8b 55 f0          	mov    -0x10(%rbp),%rdx	// rdx=(rpb-0x10)
    1170:	01 c2                	add    %eax,%edx	// edx+=eax
    1172:	8b 45 f8             	mov    -0x8(%rbp),%eax
    1175:	01 c2                	add    %eax,%edx
    1177:	8b 45 ec             	mov    -0x14(%rbp),%eax
    117a:	01 d0                	add    %edx,%eax
    117c:	5d                   	pop    %rbp
    117d:	c3                   	retq   
    117e:	66 90                	xchg   %ax,%ax

/*
 * arm
 */
000000000040051c <main>:
  40051c:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  400520:	910003fd 	mov	x29, sp
  400524:	52800083 	mov	w3, #0x4                   	// #4
  400528:	52800062 	mov	w2, #0x3                   	// #3
  40052c:	d2800041 	mov	x1, #0x2                   	// #2
  400530:	52800020 	mov	w0, #0x1                   	// #1
  400534:	94000004 	bl	400544 <add>
  400538:	52800000 	mov	w0, #0x0                   	// #0
  40053c:	a8c17bfd 	ldp	x29, x30, [sp], #16
  400540:	d65f03c0 	ret

0000000000400544 <add>:
  400544:	d10083ff 	sub	sp, sp, #0x20
  400548:	39007fe0 	strb	w0, [sp, #31]
  40054c:	f9000be1 	str	x1, [sp, #16]
  400550:	b9001be2 	str	w2, [sp, #24]
  400554:	b9000fe3 	str	w3, [sp, #12]
  400558:	39407fe0 	ldrb	w0, [sp, #31]
  40055c:	f9400be1 	ldr	x1, [sp, #16]
  400560:	0b010001 	add	w1, w0, w1
  400564:	b9401be0 	ldr	w0, [sp, #24]
  400568:	0b000021 	add	w1, w1, w0
  40056c:	b9400fe0 	ldr	w0, [sp, #12]
  400570:	0b000020 	add	w0, w1, w0
  400574:	910083ff 	add	sp, sp, #0x20
  400578:	d65f03c0 	ret
  40057c:	00000000 	.inst	0x00000000 ; undefined

#endif
